export default {
  phone (rule, value, callback) {
    if (value === undefined || value === '') callback()
    const zz = /^1[0-9]{10}$/
    if (!zz.test(value)) {
      callback(new Error('号码格式错误'))
    }
    callback()
  },
  email (rule, value, callback) {
    if (value === undefined || value === '') callback()
    const zz = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
    if (!zz.test(value)) {
      callback(new Error('邮箱格式错误'))
    }
    callback()
  }
}
